package com.ronglian.ucdisk.test;

import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;


@Entity
@Table(name="department")
public class Department {
	@Id public String id ; 
	
	@OneToMany( fetch=FetchType.EAGER , mappedBy="department" ,cascade = CascadeType.PERSIST )
	private List<Employee> employList; 
	
	@OneToMany( fetch=FetchType.LAZY ,mappedBy="department" ,cascade = CascadeType.PERSIST )
	private List<Parking> parkList; 
	
	public String name;
	
	public Date lastUpdateTime = new Date();
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	
	public List<Employee> getEmployList() {
		return employList;
	}
	public void setEmployList(List<Employee> employList) {
		this.employList = employList;
	}
	public List<Parking> getParkList() {
		return parkList;
	}
	public void setParkList(List<Parking> parkList) {
		this.parkList = parkList;
	}
}
